#include"SingleList.h"
void TestInsert()
{
	SLNode* pList = NULL;
	SingleListPushFront(&pList, 3);
	SingleListPushFront(&pList, 2);
	SingleListPushFront(&pList, 1);
	SingleListPrint(pList);
	printf("\n");

	SingleListPushBack(&pList, 4);
	SingleListPushBack(&pList, 5);
	SingleListPushBack(&pList, 6);
	SingleListPrint(pList);
	printf("\n");

	SLNode* pos = SingleListFind(pList, 4);
	SingleListInsertAfter(pos, 7);
	SingleListPrint(pList);
	printf("\n");
}
void TestEraseAndModify()
{
	SLNode* pList = NULL;
	SingleListPushFront(&pList, 1);
	SingleListPushFront(&pList, 2);
	SingleListPushFront(&pList, 3);
	SingleListPushFront(&pList, 4);
	SingleListPushFront(&pList, 5);
	SingleListPrint(pList);
	printf("\n");

	SingleListPopFront(&pList);
	SingleListPrint(pList);
	printf("\n");

	SingleListPopBack(&pList);
	SingleListPrint(pList);
	printf("\n");

	SLNode* pos = SingleListFind(pList, 4);
	SingleListEraseAfter(pos);
	SingleListPrint(pList);
	printf("\n");

	SingleListModify(pList, 4, 9);
	SingleListPrint(pList);
	printf("\n");
}
int main()
{
	//TestInsert();
	TestEraseAndModify();
	return 0;
}